package com.byit.domain;

import java.io.Serializable;

import com.baomidou.mybatisplus.enums.IdType;

import java.util.Date;

import com.baomidou.mybatisplus.annotations.TableId;
import com.baomidou.mybatisplus.annotations.TableField;
import com.baomidou.mybatisplus.activerecord.Model;
import com.baomidou.mybatisplus.annotations.TableName;
import lombok.Data;

import java.io.Serializable;

/**
 * <p>
 * 操作日志记录
 * </p>
 *
 * @author wangx
 * @since 2018-12-21
 */
@Data
@TableName("sys_log")
public class SysLog extends Model<SysLog> {

    private static final long serialVersionUID = 1L;

    /**
     * 日志主键
     */
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;
    /**
     * 模块标题
     */
    @TableField("title")
    private String title;
    /**
     * 方法名称
     */
    @TableField("method")
    private String method;
    /**
     * 来源渠道
     */
    @TableField("channel")
    private String channel;
    /**
     * 操作类型
     */
    @TableField("oper_type")
    private String operType;
    /**
     * 请求URL
     */
    @TableField("oper_url")
    private String operUrl;
    /**
     * 主机地址
     */
    @TableField("oper_ip")
    private String operIp;
    /**
     * 请求参数
     */
    @TableField("oper_param")
    private String operParam;
    /**
     * 操作状态（0正常 1系统异常 2操作异常）
     */
    @TableField("status")
    private String status;
    /**
     * 错误消息
     */
    @TableField("error_msg")
    private String errorMsg;
    /**
     * 操作时间
     */
    @TableField("oper_time")
    private Date operTime;
    /**
     * 操作人员
     */
    @TableField("oper_name")
    private String operName;
    /**
     * 部门名称
     */
    @TableField("dept_name")
    private String deptName;
    /**
     * 操作地点
     */
    @TableField("oper_location")
    private String operLocation;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

    @Override
    public String toString() {
        return "SysLog{" +
                ", id=" + id +
                ", title=" + title +
                ", method=" + method +
                ", channel=" + channel +
                ", operType=" + operType +
                ", operUrl=" + operUrl +
                ", operIp=" + operIp +
                ", operParam=" + operParam +
                ", status=" + status +
                ", errorMsg=" + errorMsg +
                ", operTime=" + operTime +
                ", operName=" + operName +
                ", deptName=" + deptName +
                ", operLocation=" + operLocation +
                "}";
    }
}
